import fs from 'fs'
import path from 'path'
let logpath = path.join(__dirname,'err_log.txt');
export default (errLog, req, res, next) => {
  let errStr = `
错误名称:${errLog.name}
错误详情:${errLog.message}
出现时间:${new Date()}
---------------------------------------------`
  fs.writeFile(logpath,errStr,{encoding:'utf8',flag:'a'},(err)=>{
    if(!err) console.log("出现错误，已记录")
  }) 
}
